/*
 * lib2Desa - Another 2D game library in C++
 * Copyright (C) 2009 Erivaldo Xavier de Lima Filho
 *
 * This program is free software and is distributed under GNU General Public License version 3. You can modify and/or redistribute
 * it under the terms of GPL version 3 or posterior version. This program comes with NO WARRANTY, for more details, see LICENSE,
 * or <http://www.gnu.org/licenses>.
 *
 * Contact info:
 *
 *	Erivaldo Xavier de Lima Filho, desadoc@gmail.com
 *
 */

#ifndef _AEVENTNOTIFIER_HPP
#define _AEVENTNOTIFIER_HPP

#include "Core/shared_ptr.hpp"
#include "Core/IEventNotifier.hpp"

#include <list>

#ifndef _NO_NAMESPACE
namespace lib2Desa {
#endif

class AEventNotifierIn;

class AEventNotifier : public IEventNotifier
{

protected:

	std::list<shared_ptr<IEvent> > events;
	std::list<shared_ptr<IEventListener> > listeners;

	AEventNotifier(void);

public:

	virtual ~AEventNotifier(void);

	virtual const shared_ptr<IEvent> pollEvent(void);

	virtual void addListener(const shared_ptr<IEventListener>& l);
	virtual void removeListener(const shared_ptr<IEventListener>& l);

	virtual void processEvents(void) = 0;
	virtual void notifyListeners(void);
};


#ifndef _NO_NAMESPACE
}
#endif

#endif /*AEventNotifier.hpp included*/
